package demo2;

import demo1.OutClass;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 苏李涛
 * Date: 2024-05-19
 * Time: 18:39
 */

//
public class OutClass1 {
    public int a = 10;

    //实例内部类
     class Innerclass1 {
         int a = 100;
        int c;
        public void test() {
            System.out.println(OutClass1.this.a);
        }
    }

    public static void main(String[] args) {
        //实例化，实例内部类

        //先实例化，外部类
        OutClass1 outClass1 = new OutClass1();
        //再借助，外部类实例化，实例内部类
        OutClass1.Innerclass1 innerclass1 = outClass1.new Innerclass1();
        innerclass1.test();

    }

}
